local name = vlc.strings.convert_xml_special_chars(item.name)
print("<node id=\""..tostring(item.id).."\" name=\""..name.."\" ro=\""..(item.flags.ro and "ro" or "rw").."\">")
for _, c in ipairs(item.children) do
print_playlist(c)
end
print("</node>")
else
local name, path = vlc.strings.convert_xml_special_chars(item.name,item.path or "")
print("<leaf id='"..tostring(item.id).."' uri='"..path.."' name='"..name.."' ro='"..(item.flags.ro and "ro" or "rw").."' duration='"..tostring(item.duration).."'/>")
local key = vlc.strings.decode_uri(_GET["search"])
p = vlc.playlist.search(key)
else
p = vlc.playlist.get()
end
-- a(p) Uncomment to debug
print_playlist(p)
?>
<?vlc --[[
</node>
<node id="9" name="Nevermind" ro="rw">
<leaf id="10" current="current" uri="file:///mnt/stuff/media/Nirvana/Nevermind/01 - Smells Like Teen Spirit.mp3" name="Smells Like Teen Spirit" ro="rw" duration="-1"/>